﻿#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "../../../NetEngine_Linux/NetEngine_SourceCode/XyRyNet_CommHdr.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/XyRyNet_Types.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/XyRyNet_ProtocolHdr.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/NetEngine_Client/XEngine_ClientPool/ClientPool_Define.h"
#include "../../../NetEngine_Linux/NetEngine_SourceCode/NetEngine_Client/XEngine_ClientPool/ClientPool_Error.h"

//g++ -std=gnu++11 -Wall -g Test_XClientPool.cpp -o Test_XClientPool -L ../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_BaseLib -L ../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_Client -L ../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_Core -L ../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_Client -lNetEngine_BaseLib -lNetClient_Socket -lNetEngine_ManagePool -lXEngine_ClientPool -Wl,-rpath=../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_BaseLib:../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_Client:../../../NetEngine_Linux/NetEngine_Release/NetEngine_Release/NetEngine_Core,--disable-new-dtags

void __stdcall XClient_CBRecv(XNETHANDLE xhToken, int nIndex, LPCTSTR lpszClientAddr, LPCSTR lpszMsgBuffer, int nMsgLen, LPVOID lParam)
{

}

int main()
{
    XNETHANDLE xhToken = 0;
    if (!XClient_PoolConnect_OPen(&xhToken, "192.168.4.37", 5001, 10, XClient_CBRecv, NULL))
    {
        printf("XClient_PoolConnect_OPen:%X\n", XClient_GetLastError());
        return -1;
    }

    while (1)
    {
        Sleep(1000);
    }
    XClient_PoolConnect_Close(xhToken);
    return 0;
}
